package controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import pojo.User;

@Controller
@SessionAttributes(value= {"user"})
public class SystemControlelr {
	@RequestMapping("login")
	public String login(String uname,String password,Model model) {
		if("john".equals(uname)&&"123".equals(password)) {
			User u=new User();
			u.setUname(uname);
			model.addAttribute("user",u);
			return "forward:base/findAllItems";
		}
		else {
			return "redirect:public/index.html";
		}
		
	}
}
